package com.sophossystems.client.asmon.dto;


import java.io.Serializable;

import java.util.Date;

public class UserDTO implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7928019204441956163L;

	/** 
	 * This attribute maps to the column idUser in the User table.
	 */
	protected int idUser;

	/** 
	 * This attribute maps to the column username in the User table.
	 */
	protected String username;

	/** 
	 * This attribute maps to the column password in the User table.
	 */
	protected String password;

	/** 
	 * This attribute maps to the column idRole in the User table.
	 */
	protected int idRole;

	/** 
	 * This attribute represents whether the primitive attribute idRole is null.
	 */
	protected boolean idRoleNull = true;

	/** 
	 * This attribute maps to the column Name in the User table.
	 */
	protected String name;

	/** 
	 * This attribute maps to the column Apellido in the User table.
	 */
	protected String apellido;

	/** 
	 * This attribute maps to the column SegundoApellido in the User table.
	 */
	protected String segundoApellido;

	/** 
	 * This attribute maps to the column ipaddress in the User table.
	 */
	protected String ipaddress;

	/** 
	 * This attribute maps to the column lastlogin in the User table.
	 */
	protected Date lastlogin;

	/** 
	 * This attribute maps to the column status in the User table.
	 */
	protected String status;

	/**
	 * Method 'User'
	 * 
	 */
	public UserDTO()
	{
	}

	/**
	 * Method 'getIdUser'
	 * 
	 * @return int
	 */
	public int getIdUser()
	{
		return idUser;
	}

	/**
	 * Method 'setIdUser'
	 * 
	 * @param idUser
	 */
	public void setIdUser(int idUser)
	{
		this.idUser = idUser;
	}

	/**
	 * Method 'getUsername'
	 * 
	 * @return String
	 */
	public String getUsername()
	{
		return username;
	}

	/**
	 * Method 'setUsername'
	 * 
	 * @param username
	 */
	public void setUsername(String username)
	{
		this.username = username;
	}

	/**
	 * Method 'getPassword'
	 * 
	 * @return String
	 */
	public String getPassword()
	{
		return password;
	}

	/**
	 * Method 'setPassword'
	 * 
	 * @param password
	 */
	public void setPassword(String password)
	{
		this.password = password;
	}

	/**
	 * Method 'getIdRole'
	 * 
	 * @return int
	 */
	public int getIdRole()
	{
		return idRole;
	}

	/**
	 * Method 'setIdRole'
	 * 
	 * @param idRole
	 */
	public void setIdRole(int idRole)
	{
		this.idRole = idRole;
		this.idRoleNull = false;
	}

	/**
	 * Method 'setIdRoleNull'
	 * 
	 * @param value
	 */
	public void setIdRoleNull(boolean value)
	{
		this.idRoleNull = value;
	}

	/**
	 * Method 'isIdRoleNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdRoleNull()
	{
		return idRoleNull;
	}

	/**
	 * Method 'getName'
	 * 
	 * @return String
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * Method 'setName'
	 * 
	 * @param name
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * Method 'getApellido'
	 * 
	 * @return String
	 */
	public String getApellido()
	{
		return apellido;
	}

	/**
	 * Method 'setApellido'
	 * 
	 * @param apellido
	 */
	public void setApellido(String apellido)
	{
		this.apellido = apellido;
	}

	/**
	 * Method 'getSegundoApellido'
	 * 
	 * @return String
	 */
	public String getSegundoApellido()
	{
		return segundoApellido;
	}

	/**
	 * Method 'setSegundoApellido'
	 * 
	 * @param segundoApellido
	 */
	public void setSegundoApellido(String segundoApellido)
	{
		this.segundoApellido = segundoApellido;
	}

	/**
	 * Method 'getIpaddress'
	 * 
	 * @return String
	 */
	public String getIpaddress()
	{
		return ipaddress;
	}

	/**
	 * Method 'setIpaddress'
	 * 
	 * @param ipaddress
	 */
	public void setIpaddress(String ipaddress)
	{
		this.ipaddress = ipaddress;
	}

	/**
	 * Method 'getLastlogin'
	 * 
	 * @return Date
	 */
	public Date getLastlogin()
	{
		return lastlogin;
	}

	/**
	 * Method 'setLastlogin'
	 * 
	 * @param lastlogin
	 */
	public void setLastlogin(Date lastlogin)
	{
		this.lastlogin = lastlogin;
	}

	/**
	 * Method 'getStatus'
	 * 
	 * @return String
	 */
	public String getStatus()
	{
		return status;
	}

	/**
	 * Method 'setStatus'
	 * 
	 * @param status
	 */
	public void setStatus(String status)
	{
		this.status = status;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	@Override
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof UserDTO)) {
			return false;
		}
		
		final UserDTO _cast = (UserDTO) _other;
		if (idUser != _cast.idUser) {
			return false;
		}
		
		if (username == null ? _cast.username != username : !username.equals( _cast.username )) {
			return false;
		}
		
		if (password == null ? _cast.password != password : !password.equals( _cast.password )) {
			return false;
		}
		
		if (idRole != _cast.idRole) {
			return false;
		}
		
		if (idRoleNull != _cast.idRoleNull) {
			return false;
		}
		
		if (name == null ? _cast.name != name : !name.equals( _cast.name )) {
			return false;
		}
		
		if (apellido == null ? _cast.apellido != apellido : !apellido.equals( _cast.apellido )) {
			return false;
		}
		
		if (segundoApellido == null ? _cast.segundoApellido != segundoApellido : !segundoApellido.equals( _cast.segundoApellido )) {
			return false;
		}
		
		if (ipaddress == null ? _cast.ipaddress != ipaddress : !ipaddress.equals( _cast.ipaddress )) {
			return false;
		}
		
		if (lastlogin == null ? _cast.lastlogin != lastlogin : !lastlogin.equals( _cast.lastlogin )) {
			return false;
		}
		
		if (status == null ? _cast.status != status : !status.equals( _cast.status )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	@Override
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idUser;
		if (username != null) {
			_hashCode = 29 * _hashCode + username.hashCode();
		}
		
		if (password != null) {
			_hashCode = 29 * _hashCode + password.hashCode();
		}
		
		_hashCode = 29 * _hashCode + idRole;
		_hashCode = 29 * _hashCode + (idRoleNull ? 1 : 0);
		if (name != null) {
			_hashCode = 29 * _hashCode + name.hashCode();
		}
		
		if (apellido != null) {
			_hashCode = 29 * _hashCode + apellido.hashCode();
		}
		
		if (segundoApellido != null) {
			_hashCode = 29 * _hashCode + segundoApellido.hashCode();
		}
		
		if (ipaddress != null) {
			_hashCode = 29 * _hashCode + ipaddress.hashCode();
		}
		
		if (lastlogin != null) {
			_hashCode = 29 * _hashCode + lastlogin.hashCode();
		}
		
		if (status != null) {
			_hashCode = 29 * _hashCode + status.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return UserPk
	 */
	public UserPkDTO createPk()
	{
		return new UserPkDTO(idUser);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	@Override
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.sophossystems.client.asmon.dto.User: " );
		ret.append( "idUser=" + idUser );
		ret.append( ", username=" + username );
		ret.append( ", password=" + password );
		ret.append( ", idRole=" + idRole );
		ret.append( ", name=" + name );
		ret.append( ", apellido=" + apellido );
		ret.append( ", segundoApellido=" + segundoApellido );
		ret.append( ", ipaddress=" + ipaddress );
		ret.append( ", lastlogin=" + lastlogin );
		ret.append( ", status=" + status );
		return ret.toString();
	}

}
